<template>
	<view>
		<express-list v-if="account !== 'account'"></express-list>
		<express-delivery-list v-if="account === 'account'"></express-delivery-list>
	</view>
</template>

<script>
	import expressList from './expressList.vue'
	import expressDeliveryList from './expressDeliveryList.vue'
	export default {
		components:{ expressList, expressDeliveryList },
		data() {
			return { account: 'admin' }
		},
		onLoad() {
			this.account = uni.getStorageSync('account')
			if (this.account === '') {
				this.logout()
			}
		},
		onShow() {
			this.account = uni.getStorageSync('account')
			if (this.account === '') {
				this.logout()
			}
		},
		methods: {
			logout() {
				uni.navigateTo({
					url: '/pages/login/login'
				})
			}
		}
	}
</script>
